package kg.aibek.projecteuler.p10;

import java.util.HashSet;
import java.util.Set;

public class Problem12 {
	public void solve() {
		int count = 0;
		int number = 1;
		for (int i = 2; count < 500; i++) {
			number = number + i;
			count = factorCount(number);
		}
		System.out.println(number);
	}

	private int factorCount(int number) {
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 1; i * i <= number; i++) {
			if (number % i == 0) {
				set.add(i);
				set.add(number / i);
			}
		}
		return set.size();
	}

	public static void main(String[] args) {
		Problem12 p = new Problem12();
		p.solve();
	}
}
